<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: write_customers_status.php 135 2013-09-22 07:30:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 135 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:30:55 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

if(isset($_SESSION['customer_id'])) {
    $customers_status_value_1 = $db->db_query("SELECT customers_status, admin_id FROM ".TABLE_CUSTOMERS." WHERE customers_id = '".$_SESSION['customer_id']."'");

    $customers_status_value = $db->db_query("SELECT
                                                *
                                            FROM
                                                ".TABLE_CUSTOMERS_STATUS."
                                            WHERE
                                                customers_status_id = '".$customers_status_value_1->fields['customers_status']."' AND language_id = '".$_SESSION['languages_id']."'");

    $_SESSION['customers_status'] = array();
    $_SESSION['customers_status'] = array('customers_status_id' => $customers_status_value_1->fields['customers_status'],
    									  'customers_admin_id' => $customers_status_value_1->fields['admin_id'],
									      'customers_status_name' => $customers_status_value->fields['customers_status_name'],
									      'customers_status_image' => $customers_status_value->fields['customers_status_image'],
									      'customers_status_public' => $customers_status_value->fields['customers_status_public'],
									      'customers_status_min_order' => $customers_status_value->fields['customers_status_min_order'],
									      'customers_status_max_order' => $customers_status_value->fields['customers_status_max_order'],
									      'customers_status_discount' => $customers_status_value->fields['customers_status_discount'],
									      'customers_status_ot_discount_flag' => $customers_status_value->fields['customers_status_ot_discount_flag'],
									      'customers_status_ot_discount' => $customers_status_value->fields['customers_status_ot_discount'],
									      'customers_status_graduated_prices' => $customers_status_value->fields['customers_status_graduated_prices'],
									      'customers_status_show_price' => $customers_status_value->fields['customers_status_show_price'],
									      'customers_status_show_price_tax' => $customers_status_value->fields['customers_status_show_price_tax'],
									      'customers_status_add_tax_ot' => $customers_status_value->fields['customers_status_add_tax_ot'],
									      'customers_status_payment_unallowed' => $customers_status_value->fields['customers_status_payment_unallowed'],
									      'customers_status_shipping_unallowed' => $customers_status_value->fields['customers_status_shipping_unallowed'],
									      'customers_status_discount_attributes' => $customers_status_value->fields['customers_status_discount_attributes'],
									      'customers_fsk18' => $customers_status_value->fields['customers_fsk18'],
									      'customers_fsk18_display' => $customers_status_value->fields['customers_fsk18_display'],
									      'customers_status_write_reviews' => $customers_status_value->fields['customers_status_write_reviews'],
									      'customers_status_read_reviews' => $customers_status_value->fields['customers_status_read_reviews']);

} else {
    $customers_status_value = $db->db_query("SELECT
	                                                *
	                                            FROM
	                                                ".TABLE_CUSTOMERS_STATUS."
	                                            WHERE
	                                                customers_status_id = '".DEFAULT_CUSTOMERS_STATUS_ID_GUEST."' AND language_id = '".$_SESSION['languages_id']."'");

    $_SESSION['customers_status'] = array();
    $_SESSION['customers_status'] = array('customers_status_id' => DEFAULT_CUSTOMERS_STATUS_ID_GUEST,
									      'customers_status_name' => $customers_status_value->fields['customers_status_name'],
									      'customers_status_image' => $customers_status_value->fields['customers_status_image'],
									      'customers_status_discount' => $customers_status_value->fields['customers_status_discount'],
									      'customers_status_public' => $customers_status_value->fields['customers_status_public'],
									      'customers_status_min_order' => $customers_status_value->fields['customers_status_min_order'],
									      'customers_status_max_order' => $customers_status_value->fields['customers_status_max_order'],
									      'customers_status_ot_discount_flag' => $customers_status_value->fields['customers_status_ot_discount_flag'],
									      'customers_status_ot_discount' => $customers_status_value->fields['customers_status_ot_discount'],
									      'customers_status_graduated_prices' => $customers_status_value->fields['customers_status_graduated_prices'],
									      'customers_status_show_price' => $customers_status_value->fields['customers_status_show_price'],
									      'customers_status_show_price_tax' => $customers_status_value->fields['customers_status_show_price_tax'],
									      'customers_status_add_tax_ot' => $customers_status_value->fields['customers_status_add_tax_ot'],
									      'customers_status_payment_unallowed' => $customers_status_value->fields['customers_status_payment_unallowed'],
									      'customers_status_shipping_unallowed' => $customers_status_value->fields['customers_status_shipping_unallowed'],
									      'customers_status_discount_attributes' => $customers_status_value->fields['customers_status_discount_attributes'],
									      'customers_fsk18' => $customers_status_value->fields['customers_fsk18'],
									      'customers_fsk18_display' => $customers_status_value->fields['customers_fsk18_display'],
									      'customers_status_write_reviews' => $customers_status_value->fields['customers_status_write_reviews'],
									      'customers_status_read_reviews' => $customers_status_value->fields['customers_status_read_reviews']);
}
?>